<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<title>周边炉投入铝汤 - 表单</title>
	<link rel="stylesheet" href="../../css/base.css" />
	<link rel="stylesheet" href="../../css/index.css" />
	<style type="text/css">
		.btn-submit {
			display: block;
		}
	</style>
</head>

<body>
	<div id="caozuochengg" style="background-color:#fff; font-size:16px; border: solid 4px #ff0000; display:none;
 width:80%; padding:10px; position:absolute; top:50%;left:5%; z-index:9999; text-align:center;">操作成功！3秒后自动消失。</div>
	<div class="header">
		<!-- api.closeWin(); -->
		<span onclick="api.closeWin()" class="goBack" id="tishi" style="font-size: 10px;">返回</span><span
			onclick="open_config()">机边炉加入铝汤</span>
		<span class="code" onclick="sjerweima()"><i
				class="H-iconfont H-icon-scanning H-font-size-28 H-vertical-middle"></i></span>
	</div>
	<div class="fingerprint bg-ybzck">
		<div class="textBox">
			<ul>
				<li>
					<p>扫描机机边保温炉二维码</p>
					<input type="text" readonly="readonly" class="textStyle" name="FJBLNumber" id="inp1"
						onclick="erweima(1,'YZJ')" />
				</li>
				<li>
					<p>扫描汤包二维码，材料牌号</p>
					<input type="text" readonly="readonly" class="textStyle" name="FTBNumber" id="inp2"
						onclick="erweima(2,'ZYB')" style="width:90px;" />
					<input type="text" readonly="readonly" class="textStyle" name="TBCLPH" id="TBCLPH"
						onclick="erweima(2,'ZYB')" style="width:130px;" />
				</li>
				<li>
					<p>扫描压铸产品二维码，材料牌号</p>
					<input type="text" readonly="readonly" class="textStyle" name="FProNumber" id="inp3"
						onclick="erweima(3,'CP')" />
				</li>
				<li>
					<p>扫描转运操作工二维码</p>
					<input type="text" readonly="readonly" class="textStyle" name="FEmplNameZY" id="inp4"
						onclick="erweima(4,'YG')" />
				</li>
			</ul>
		</div>
		<p class="btn-submit" style="position:relative;">
			<input type="button" value="记录" class="btn btn2"
				onclick="db.openWin({url:'../zbltrltList/zbltrltList_body.html'})" style="width: 90px;" />
			<input type="button" value="关闭" class="btn btn2" onclick="guanbi();" style="width: 90px;" />
			<!--<input type="button" value="日志" class="btn btn2" onclick="$('.kjjjskxjjx').show();" style="width: 90px;" />-->
			<input type="button" value="提交" class="btn btn2" style="width: 90px;" onclick="submitFun();" />
		</p>
	</div>
	<script src="../../script/base/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>

	<!-- <script type="text/javascript" src="../../script/jquery.signalR-2.2.0.js"></script> -->
	<!--<script type="text/javascript" src="http://47.91.250.49:9079/signalr/hubs"></script>-->
	<script src="../../script/layer/layer.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../script/DbHelper.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../script/webSocket.js"></script>
	<script type="text/javascript">
		//---------------signalr---------------------
		var machineHub;
		var toClientId = '';
		//弹窗
		function open_config() {
			var html = $('#temp_config').html();
			var index = layer.open({
				type: 1,
				title: false,
				closeBtn: 0,
				shadeClose: false,
				area: ['300px', 'auto'],
				content: html,
				success: function () {
					$('#jw_ip').val(localStorage.getItem("jw_ip") || '172.28.0.202');
					$('#jw_port').val(localStorage.getItem("jw_port") || '8888');
					$('#jw_userName').val(localStorage.getItem("jw_userName") || 'jwyclzspda');
					$('#jw_toName').val(localStorage.getItem("jw_toName") || 'JWIKD5');
				}
			});
			$("#temp_config").data("index", index); //设置弹框id
		}
		//保存
		function bc_config() {
			localStorage.setItem("jw_ip", $('#jw_ip').val());
			localStorage.setItem("jw_port", $('#jw_port').val());
			localStorage.setItem("jw_userName", $('#jw_userName').val());
			localStorage.setItem("jw_toName", $('#jw_toName').val());
			//关闭层
			layer.close($("#temp_config").data("index"));
			//链接websocket
			var obj = {
				jw_ip: localStorage.getItem("jw_ip"),
				jw_port: localStorage.getItem("jw_port"),
				jw_userName: localStorage.getItem("jw_userName"),
				jw_toName: localStorage.getItem("jw_toName")
			}
			websocketObj.ip = obj.jw_ip;
			websocketObj.port = obj.jw_port;
			websocketObj.userName = obj.jw_userName;
			websocketObj.toName = obj.jw_toName;
			layer.msg('保存成功');
			location.reload();
		}
		var websocketObj = {
			//websocket对象
			ws: null,
			//true：链接成功，false：链接失败
			isconn: false,
			setIntervalObj: setInterval(function () { }, 1),
			ip: '',
			port: '',
			toName: '',
			userName: ''
		};
		//WebSocket对象创建
		websocketObj.concact = function () {
			try {

				websocketObj.ws = new WebSocket("ws://" + websocketObj.ip + ":" + websocketObj.port);
				websocketObj.ws.onopen = function () {
					$("#tishi").html('与服务器链接成功')
					console.log('websocket---connect')
					if (websocketObj.userName)
						websocketObj.ws.send("LOGIN," + websocketObj.userName + ",密码信息");
				}
				websocketObj.ws.onmessage = function (evt) {
					var data = evt.data;
					console.log(data)
					$("#tishi").html('信号正常')
					if (data && /^ACK/.test(data) && /LOGIN/.test(data)) {
						websocketObj.isconn = true;
						console.log('login---ok')
					}
				}
				websocketObj.ws.onclose = function () {
					console.log('websocket---close')
					$("#tishi").html('与服务器链接中断')
					websocketObj.isconn = false;
				};
				websocketObj.ws.onerror = function () {
					console.log('websocket---error')
					$("#tishi").html('与服务器链接异常')
					websocketObj.isconn = false;
				};
			} catch (e) {
				//TODO handle the exception
			}
		}

		$(function () {
			//没有设置过时弹出
			if (localStorage.getItem("jw_ip") == null) {
				open_config();
			} else {
				var obj = {
					jw_ip: localStorage.getItem("jw_ip"),
					jw_port: localStorage.getItem("jw_port"),
					jw_userName: localStorage.getItem("jw_userName"),
					jw_toName: localStorage.getItem("jw_toName")
				}
				websocketObj.ip = obj.jw_ip;
				websocketObj.port = obj.jw_port;
				websocketObj.userName = obj.jw_userName;
				websocketObj.toName = obj.jw_toName;
				//链接服务器websocket
				websocketObj.concact();
				layer.msg('点击标题，可以设置WebSocket参数');
				setInterval(function () {
					try {
						if (websocketObj.isconn)
							websocketObj.ws.send("HEARTBEAT," + new Date().getTime());
						else
							websocketObj.concact();
					} catch (e) {
						console.log('webSocket发送失败')
					}
				}, 2000);
			}
		})

		//关闭栏杆
		function guanbi() {
			active("0");
		}
		//测试数据
		var yzjdata = ['46;压铸机 IKD-5/YZ-005-01;172.24.4.1'
			, '56;压铸机 IKD-5/YZ-005-13;172.24.2.95'
			, '57;压铸机 IKD-5/YZ-005-09;172.24.4.131'
			, '60;压铸机 IKD-5/YZ-005-34;172.24.4.200'
			, '61;压铸机 IKD-5/YZ-005-33;172.24.3.8'
			, '62;压铸机 IKD-5/YZ-005-46;172.24.1.7'
			, '63;压铸机 IKD-5/YZ-005-44;172.24.4.72'
			, '64;压铸机 IKD-5/YZ-005-43;172.24.4.89'
			, '65;压铸机 IKD-5/YZ-005-38;172.24.4.101'
			, '66;压铸机 IKD-5/YZ-005-37;172.24.4.48'
			, '67;压铸机 IKD-5/YZ-005-17;172.24.4.31'
			, '68;压铸机 IKD-5/YZ-005-19;172.24.4.33'
			, '69;压铸机 IKD-5/YZ-005-18;172.24.4.78'
			, '70;压铸机 IKD-5/YZ-005-20;172.24.4.35'
			, '359;压铸机 IKD-5/YZ-005-27;172.24.4.90'
			, '1364;压铸机 IKD-5/YZ-005-02;172.24.3.250'
			, '1534;压铸机 IKD-5/YZ-005-32;172.24.4.84'
			, '1746;压铸机 IKD-5/YZ-005-50;172.24.4.47'
			, '2252;压铸机 IKD-5/YZ-005-29;172.24.1.43'
			, '2253;压铸机 IKD-5/YZ-005-31;172.24.5.130'
			, '2254;压铸机 IKD-5/YZ-005-30;172.24.4.71'
			, '2255;压铸机 IKD-5/YZ-005-28;172.24.4.87'
			, '2257;压铸机 IKD-5/YZ-005-26;172.24.9.131'
			, '2654;压铸机 IKD-5/YZ-005-12;172.24.0.81'
			, '2667;压铸机 IKD-5/YZ-005-07;172.24.4.36'
			, '2668;压铸机 IKD-5/YZ-005-14;172.24.4.26'
			, '2669;压铸机 IKD-5/YZ-005-15;172.24.4.128'
			, '2670;压铸机 IKD-5/YZ-005-25;172.24.4.94'
			, '2671;压铸机 IKD-5/YZ-005-35;172.24.4.44'
			, '2672;压铸机 IKD-5/YZ-005-36;172.24.4.45'
			, '2673;压铸机 IKD-5/YZ-005-41;172.24.4.96'
			, '2674;压铸机 IKD-5/YZ-005-42;172.24.4.93'
			, '2675;压铸机 IKD-5/YZ-005-45;172.24.4.69'
			, '2676;压铸机 IKD-5/YZ-005-52;172.24.4.51'
			, '2686;压铸机 IKD-5/YZ-005-11;172.24.4.52'
			, '2824;压铸机 IKD-5/YZ-005-51;172.24.4.50'
			, '2949;压铸机 IKD-5/YZ-005-22;172.24.9.143'
			, '2950;压铸机 IKD-5/YZ-005-23;172.24.4.99'
			, '2951;压铸机 IKD-5/YZ-005-24;172.24.4.98'
			, '2957;压铸机 IKD-5/YZ-005-03;172.24.4.11'
			, '2958;压铸机 IKD-5/YZ-005-04;172.24.4.12'
			, '3382;压铸机 IKD-5/YZ-005-05;172.24.0.149'
			, '3595;压铸机 IKD-5/YZ-005-10;172.24.0.18'
			, '3596;压铸机 IKD-5/YZ-005-40;172.24.4.100'
			, '3602;压铸机 IKD-5/YZ-005-49;172.24.8.163'
			, '3680;压铸机 IKD-5/YZ-005-48;172.24.4.106'
			, '3750;压铸机 IKD-5/YZ-005-06;172.24.4.18'
			, '3751;压铸机 IKD-5/YZ-005-08;172.24.4.15'
			, '3780;压铸机 IKD-5/YZ-005-47;172.24.4.108'];
		//测试关杆
		function testclose() {
			layer.prompt({ title: '输入机台编号跟IP地址', formType: 2 }, function (sbid, index) {
				var m = new Date();
				var time = new Date(m.getTime() + 1000 * 10);

				var Y = time.getFullYear();
				var M = getDate(time.getMonth() + 1);
				var d = getDate(time.getDate());
				var h = getDate(time.getHours());
				var m = getDate(time.getMinutes());
				var s = getDate(time.getSeconds());

				//测试模拟关闭时间
				var closetime = Y + '-' + M + '-' + d + ' ' + h + ':' + m + ':' + s;
				//alert(closetime)

				//获取测试几台数据
				var sbdata = [];
				for (var i = 0; i < yzjdata.length; i++) {
					var temps = yzjdata[i].split(';');
					if (temps[0] == sbid) {
						sbdata = temps; break;
					}
				}
				//alert(sbdata[2])
				if (sbdata.length > 0) {
					websocketObj.ws.send("SEND," + websocketObj.toName + ",0;" + sbid + ";" + sbdata[2] + ";" + closetime + ";test");
					//弹出提示
					layer.msg('关；压铸机名称：' + sbdata[1] + '；<br>极采盒IP：' + sbdata[2]);
				} else
					layer.msg('不在测试设备范围内！');

				layer.close(index);
			});
		}
		//测试抬杆
		function testopen() {
			layer.prompt({ title: '输入机台编号跟IP地址', formType: 2 }, function (sbid, index) {
				var m = new Date();
				var time = new Date(m.getTime() + 1000 * 10);

				var Y = time.getFullYear();
				var M = getDate(time.getMonth() + 1);
				var d = getDate(time.getDate());
				var h = getDate(time.getHours());
				var m = getDate(time.getMinutes());
				var s = getDate(time.getSeconds());

				//测试模拟关闭时间
				var closetime = Y + '-' + M + '-' + d + ' ' + h + ':' + m + ':' + s;
				//alert(closetime)

				//获取测试几台数据
				var sbdata = [];
				for (var i = 0; i < yzjdata.length; i++) {
					var temps = yzjdata[i].split(';');
					if (temps[0] == sbid) {
						sbdata = temps; break;
					}
				}
				//alert(sbdata[2])
				if (sbdata.length > 0) {
					websocketObj.ws.send("SEND," + websocketObj.toName + ",1;" + sbid + ";" + sbdata[2] + ";" + closetime + ";test");
					//弹出提示
					layer.msg('开；压铸机名称：' + sbdata[1] + '；<br>极采盒IP：' + sbdata[2] + '；<br>预计关闭时间：' + closetime);
				} else
					layer.msg('不在测试设备范围内！');

				layer.close(index);
			});
		}
		function getDate(num) {
			if (num < 10) {
				return "0" + num;
			} else {
				return num;
			}
		}
		//是否正常连接着
		var optConfig = {};
		function active(status, EquipmentNumber, __IP, __dtime) {
			//alert(__IP)
			addlog(status, function (data1) {
				var data2 = eval('(' + data1 + ')');
				if (data2.msg.ds[0].status == '000000') {
					//获取当前执行参数,打开栏杆
					if (status == "1") {
						optConfig.EquipmentNumber = EquipmentNumber;
						optConfig.IP = __IP;
						optConfig.dtime = __dtime.replace("T", " ");
					}
					if (optConfig.IP != '') {
						$("#caozuochengg").html('操作成功！3秒后自动消失。<hr>唯一事件码：' + data2.msg.ds1[0].GUID);
						if (optConfig.EquipmentNumber == '')
							optConfig.EquipmentNumber = db.Data.get("YZJ");
						// websocketObj.ws.send("SEND," + websocketObj.toName + "," + status + ";" + optConfig.EquipmentNumber +
						//     ";" + optConfig.IP + ";" + optConfig.dtime + ";" + data2.msg.ds1[0].GUID);


						$.ajax({
							url: "http://192.168.11.13:8080",
							data: { "status": status, EquipmentNumber: optConfig.EquipmentNumber, IP: optConfig.IP, dtime: optConfig.dtime, GUID: data2.msg.ds1[0].GUID },
							dataType: "jsonp",
							type: 'get',
							jsonp: "theFunction",
							jsonpCallback: "showData",
							success: function (ret) {

							},
							error: function (xhr) {
								alert("错误提示:" + xhr.status + " " + xhr.statusText);
							}
						})



					} else {
						var quyuID = db.Data.get("quyuID");
						if (quyuID == 116) {
							alert('当前机台，缺少IP地址配置');
						}
					}
				}
			})
		}
		//允许摇一摇
		var yaoyiyao = true;
		//0表示一次扫描一次关闭   1表示连续扫描
		var autoS = 0;
		var ex = "";
		var save = true; //是否执行正常保存
		apiready = function () {
			//监听声音键
			db.syjt(function (ret, err) {
				sjerweima();
			});
			//获取之前的汤包信息
			if (db.Data.get("TBinp2k") != '') {
				$("#inp2").val('' + db.Data.get("TBinp2k"));
				db.Data.set("ZYB", "" + db.Data.get("TBinp2n"));
				//材料牌号
				$("#TBCLPH").val('' + db.Data.get("TBCLPH2k"));
			}

			//获取之前的转运工信息
			if (db.Data.get("reZYG") != '') {
				$("#inp4").val(db.Data.get("reZYG"));
			}

			////触发了摇一摇事件
			//api.addEventListener({
			//    name: 'shake'
			//}, function (ret, err) {
			//    if (yaoyiyao) {
			//        //不允许摇一摇打开了
			//        yaoyiyao = false;
			//        sjerweima();
			//    }
			//});
		}
		//添加日志
		function addlog(status, fun) {
			db.ajax(function (ret, err) {
				//验证服务端是否执行正确，不正确则内部直接提示错误信息
				if (!db.dfc(ret, "api53251,返回数据格式错误，请联系IT部门！")) return;
				fun(ret)
			}, "api53251", "post", {
				FButtonType: status == '1' ? '开' : '关',
				FDeviceNo: '' + db.Data.get("YZJ"),
				FTBNumber: '' + db.Data.get("ZYB"),
				FProNumber: '' + db.Data.get("CP"),
				FLPID: '' + db.Data.get("_FLPID"),
				FRealName: '' + db.Data.get("YG"),
				PDATime: '',
				FCreater: db.login.Userid()
			}, {
				title: '提交中',
				text: '请耐心等待...'
			});
		}

		var setTimeoutObj1 = window.setTimeout(function () { }, 1);
		//提交
		function submitFun() {
			if ($("#inp1").val() == "") {
				logMsgFun("请扫描压铸机二维码");
				return;
			}
			if ($("#inp3").val() == "") {
				logMsgFun("请扫描产品二维码");
				return;
			}
			db.ajax(function (ret, err) {
				//验证服务端是否执行正确，不正确则内部直接提示错误信息
				if (!db.dfc(ret)) return;

				var data = eval('(' + ret + ')');
				var das = data.msg.ds;
				var status = das[0].status, msg = das[0].msg;
				if (status == '000000') {
					try {
						//FSBBH 设备ID，FJCHDZ 地址，FGBSJ 关闭时间
						//打开投汤栏杆
						active("1", '' + das[0].FSBBH, '' + das[0].FJCHDZ, '' + das[0].FGBSJ);
					} catch (e) {
						//只记录，不提示
						logMsgFun('远程连接生产设备【' + db.Data.get("YZJ") + '】失败，请手动操作生产设备！', false);
					}
					//只记录，不提示
					logMsgFun(msg, false);
					//显示成功提示内容
					$("#caozuochengg").html(msg);
					$("#caozuochengg").show();
					//
					try { window.clearTimeout(setTimeoutObj1); } catch (e) { }

					try {
						//3秒后隐藏成功提示内容
						setTimeoutObj1 = window.setTimeout(function () {
							$("#caozuochengg").hide();
							$("#caozuochengg").html('');
						}, 3000);
					} catch (e) {
						$("#caozuochengg").hide();
						$("#caozuochengg").html('');
					}

					//清空炉号
					$("#inp1").val('');
					//db.Data.set("YZJ", "");
					//清空产品
					$("#inp3").val('');
					db.Data.set("CP", "");
				} else {
					logMsgFun(msg);
					//db.Ts.toast(msg,2000,'x');
				}
			}, "insertZS_SoupTR", "post", {
				FJBLNumber: '' + db.Data.get("YZJ"),
				FTBNumber: '' + db.Data.get("ZYB"),
				FProNumber: '' + db.Data.get("CP"),
				//FLPID: ''+ db.Data.get("FLPID"),
				FLPID: '' + db.Data.get("_FLPID"),
				FEmplNameZY: '' + db.Data.get("YG"),
				FCreater: db.login.Userid()//db.Data.toInt(db.login.Userid(), 0)
			}, { title: '提交中', text: '请耐心等待...' });
		}

		//TC20的PDA，焦点做法才会被识别到该方法
		jw.scanfun = function (ret) {
			//区域编号
			var jwquyuID = db.Data.get("quyuID");
			//3号厂的TC20PDA使用该方法
			if (jwquyuID != null) {
				//连续扫描
				autoS = 0;
				scancode(ret);
			}
		}

		function scancode(ret) {
			var ipt1 = $("#inp1").val();
			var ipt2 = $("#inp2").val();
			var ipt3 = $("#inp3").val();
			//二维码解析
			db.Data.sjerweimajiexi(ret, function (q, n, k) {
				var s = 0;
				//随机扫描赋值
				if (q == "YZJ") {
					s = 1;
					db.Data.set("YZJ", n);
					$("#inp1").val(k);
					//吕昌
					db.submit("M_Get_SBHQCP_a", {
						FJBLNumber: n
					}, function (ret, err) {
						try {
							var data = eval('(' + ret + ')');
							var das = data.msg.ds;
							if (das != undefined && das.length > 0) {
								db.Data.set("CP", das[0].FID);
								$("#inp3").val(das[0].FName);
							}
						} catch (e) { }
					});

					//重新打开红外线
					if (sess() && autoS == 1) sjerweima();
				}
				if (q == "ZYB") {
					s = 1;
					$("#inp2").val(k);
					//记录汤包信息，下次可以不用重复扫
					db.Data.set("TBinp2n", n);
					db.Data.set("TBinp2k", k);
					//获取材料牌号
					getCLPH(n, 'ZYB', function (val) {
						$("#TBCLPH").val('' + val);
						db.Data.set("TBCLPH2k", val);
					});
					//重新打开红外线
					if (sess() && autoS == 1) sjerweima();
				}
				if (q == "CP") {
					s = 1;
					//临时存储
					db.Data.set("CP", n);
					$("#inp3").val(k);
					//重新打开红外线
					if (sess() && autoS == 1) sjerweima();
				}
				if (q == "YG") {
					s = 1;
					$("#inp4").val(k);
					//记录当前转运工
					db.Data.set("reZYG", k);
					//重新打开红外线
					if (sess() && autoS == 1) sjerweima();
				}

				if (s <= 0) {
					//db.Ts.toast('当前二维码非法',2000,'x');
					return;
				}

				db.Data.set(q, n);
				//临时存储
				if (ipt1 == "" || ipt2 == "" || ipt3 == "") {
					return;
				}
			});
		}
		//扫描二维码
		function erweima(val, type) {
			//区域编号
			var jwquyuID = db.Data.get("quyuID");
			//3号厂的TC20PDA使用该方法
			if (jwquyuID != null) { return false; }
			db.hw({
				fun: function (ret, err) {

					//非连续扫描
					autoS = 0;
					var ipt1 = $("#inp1").val();
					var ipt2 = $("#inp2").val();
					var ipt3 = $("#inp3").val();
					//二维码解析
					db.Data.erweimajiexi(ret, type, function (n, k) {
						//记录汤包信息，下次可以不用重复扫
						if (val == 2 && type == 'ZYB') {
							db.Data.set("TBinp2n", n);
							db.Data.set("TBinp2k", k);
							//获取材料牌号
							getCLPH(n, 'ZYB', function (val) {
								$("#TBCLPH").val('' + val);
								db.Data.set("TBCLPH2k", val);
							});
						}
						//记录员工
						if (type == 'YG') {
							//记录当前转运工
							db.Data.set("reZYG", k);
						}
						//临时存储
						db.Data.set(type, n);
						$("#inp" + val).val(k); //赋值
						//吕昌
						if (type == 'YZJ') {
							db.submit("M_Get_SBHQCP_a", {
								FJBLNumber: n
							}, function (ret, err) {
								try {
									var data = eval('(' + ret + ')');
									var das = data.msg.ds;
									if (das != undefined && das.length > 0) {
										db.Data.set("CP", das[0].FID);
										$("#inp3").val(das[0].FName);
									}
									if (data.msg.ds1 != undefined && data.msg.ds1.length > 0) {
										db.Data.set("_FLPID", data.msg.ds1[0].FLPID);
									}
								} catch (e) { }
							});
						}

						if (ipt1 == "" || ipt2 == "" || ipt3 == "") {
							return;
						}
					});
				}
			});
		}

		//在连续扫描状态下，是否已经完成了所有的扫描
		//true：允许继续扫描，false：不允许继续扫描
		function sess() {
			if ($("#inp1").val() == '' || $("#inp2").val() == '' || $("#inp3").val() == '' || $("#inp4").val() == '')
				//允许继续扫描
				return true;
			//不允许扫描
			return false;
		}
		//随机扫描
		function sjerweima() {
			//区域编号
			var jwquyuID = db.Data.get("quyuID");
			//3号厂的TC20PDA使用该方法
			if (jwquyuID != null) { return false; }
			db.hw({
				fun: function (ret, err) {
					//允许摇一摇
					yaoyiyao = true;
					//连续扫描
					autoS = 1;
					scancode(ret);
				}
			});
		}
	</script>
</body>

</html>
<script type="text/plain" id="temp_config" beizhu="模板">
    <div class="div_config" style="margin:0;background: #000;">
        <div class="textBox" style="padding-top:40px;">
            <ul>
                <li>
                    <p>IP</p>
                    <input type="text" class="textStyle" id="jw_ip" />
                </li>
                <li>
                    <p>端口</p>
                    <input type="text" class="textStyle" id="jw_port" />
                </li>
                <li>
                    <p>登入名</p>
                    <input type="text" class="textStyle" id="jw_userName" />
                </li>
                <li>
                    <p>上位机名</p>
                    <input type="text" class="textStyle" id="jw_toName" />
                </li>
            </ul>
        </div>
        <p class="btn-submit" style="text-align: center;">
            <input type="button" value="保存" class="btn btn2" style="width: 90px;" onclick="bc_config();" />
            <input type="button" value="测试抬杆" onclick="testopen()" />
            <input type="button" value="测试关杆" onclick="testclose()" />
        </p>
    </div>
</script>